// 导入组件
import Vue from "vue";
import Router from "vue-router";
// 登录
import login from "@/views/login";
// 首页
import index from "@/views/index";

/**
 * 基础菜单
 */
// 商品管理
import Goods from "@/views/goods/Goods";
// 身份管理
import SetIdentity from "@/views/setIdentity/SetIdentity";
// 订单页面
import user from "@/views/system/user";
// 判断说明内容配置
import explaindiSposition from "@/views/system/explaindiSposition";
// 用户管理
import MachineConfig from "@/views/machine/MachineConfig";

import set from "@/views/setting/set";

import refund from "@/views/refund/index";

import bargain from "@/views/bargain/index";

import authority from "@/views/authority/index";

import rechargeList from "@/views/recharge/rechargeList";

import setRecharge from "@/views/recharge/setRecharge";

import coupon from "@/views/coupon/index";

import giftPack from "@/views/giftPack/giftPack";

import giftRecord from "@/views/giftRecord/giftRecord";

import article from "@/views/article/index";

import company from "@/views/company/index";

import tag from "@/views/tag/index";

import error from "../components/error.vue";

import report from "@/views/report/index";

import homeImg from '@/views/setHomeImg/index';

import invoice from '@/views/invoice/invoice';

import distribution from '@/views/distribution/distribution';

import distributionCheck from '@/views/distribution/distributionCheck';

import withdrawCheck from '@/views/distribution/withdrawCheck';

import accountStatement from '@/views/accountStatement/accountStatement';

import brand from '@/views/brand/brand';

import place from '@/views/place/place';

import feedback from '@/views/feedback/feedback';

import evaluate from '@/views/evaluate/evaluate';

import encapsulation from '@/views/encapsulation/encapsulation';

import meeting from '@/views/meeting/meeting';

import meetingRecord from '@/views/meetingRecord/meetingRecord';

import sign from '@/views/signActivity/sign'; //

import activity from '@/views/signActivity/activity';

// 启用路由
Vue.use(Router);

// 导出路由
export default new Router({
  routes: [
    {
      path: "/",
      name: "",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/login",
      name: "登录",
      component: login,
      hidden: true,
      meta: {
        requireAuth: false
      }
    },
    {
      path: "/error",
      name: "404",
      component: error,
      meta: {
        requireAuth: false
      },
      component: () => import("../components/error.vue")
    },
    {
      path: "*",
      redirect: "/error"
    },
    {
      path: "/index",
      name: "首页",
      component: index,
      iconCls: "el-icon-tickets",
      children: [
        {
          path: "/goods/Goods",
          name: "商品管理",
          component: Goods,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/setIdentity/SetIdentity",
          name: "身份管理",
          component: SetIdentity,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/system/user",
          name: "订单页面",
          component: user,
          meta: {
            requireAuth: true
          },
        },
        {
          path: "/system/explaindiSposition",
          name: "判断说明内容配置",
          component: explaindiSposition,
          meta: {
            requireAuth: true
          },
        },
        {
          path: "/machine/MachineConfig",
          name: "用户管理",
          component: MachineConfig,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/authority/index",
          name: "账号管理",
          component: authority,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/tag/index",
          name: "标签管理",
          component: tag,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/report/index",
          name: "统计中心",
          component: report,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/refund/index",
          name: "退款管理",
          component: refund,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/bargain/index",
          name: "砍价管理",
          component: bargain,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/setting/set",
          name: "控制管理",
          component: set,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/brand/brand",
          name: "品牌管理",
          component: brand,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/place/place",
          name: "产地管理",
          component: place,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/encapsulation/encapsulation",
          name: "封装管理",
          component: encapsulation,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/invoice/invoice",
          name: "开票记录",
          component: invoice,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/distribution/distribution",
          name: "分销管理",
          component: distribution,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/distribution/distributionCheck",
          name: "分销商申请审核",
          component: distributionCheck,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/distribution/withdrawCheck",
          name: "分销商提现审核",
          component: withdrawCheck,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/accountStatement/accountStatement",
          name: "流水列表",
          component: accountStatement,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/feedback/feedback",
          name: "用户反馈",
          component: feedback,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/evaluate/evaluate",
          name: "用户评价",
          component: evaluate,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/recharge/rechargeList",
          name: "充值管理 > 充值列表",
          component: rechargeList,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/recharge/setRecharge",
          name: "充值管理 > 充值设置",
          component: setRecharge,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/coupon/index",
          name: "优惠劵管理",
          component: coupon,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/giftPack/giftPack",
          name: "礼包管理",
          component: giftPack,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/giftRecord/giftRecord",
          name: "礼包流水",
          component: giftRecord,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/article/index",
          name: "文章管理",
          component: article,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/company/index",
          name: "公司管理",
          component: company,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/setHomeImg/index",
          name: "首页管理",
          component: homeImg,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/meeting/meeting",
          name: "会议室管理",
          component: meeting,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/meetingRecord/meetingRecord",
          name: "预约记录",
          component: meetingRecord,
          meta: {
            requireAuth: true
          },

        },
        {
          path: "/signActivity/sign",
          name: "报名管理",
          component: sign,
          meta: {
            requireAuth: true
          }
        },
        {
          path: "/signActivity/activity",
          name: "活动管理",
          component: activity,
          meta: {
            requireAuth: true
          }
        }
      ]
    }
  ]
});
